#include <iostream>
using namespace std;


// 蛋白类
class egg_white
{
public:
    egg_white()
    {
        cout << "蛋白类构造函数" << endl;
    }
    egg_white(float a): egg_white_weight(a)
    {
        cout << "蛋白类带参数构造函数" << endl;
    }

    float egg_white_weight;
    ~egg_white()
    {
        cout << "蛋白类析构函数" << endl;
    }
};
// 蛋黄类
class egg_yolk
{
public:
    egg_yolk()
    {
        cout << "蛋黄类构造函数" << endl;
    }
    egg_yolk(float b): egg_yolk_weight(b)
    {
        cout << "蛋黄类带参数构造函数" << endl;
    }
    ~egg_yolk()
    {
        cout << "蛋黄类析构函数" << endl;
    }

    float egg_yolk_weight;
};

// 鸡蛋类
class egg: public egg_white, public egg_yolk
{
public:
    egg()
    {
        cout << "鸡蛋类构造函数" << endl;
    }
    egg(float a, float b, float c): egg_white(a), egg_yolk(b), egg_shell_weight(c)
    {
        cout << "鸡蛋类带参数构造函数" << endl;
    }
    ~egg()
    {
        cout << "鸡蛋类析构函数" << endl;
    }

    void show()
    {
        cout << "蛋白重量: " << egg_white_weight << endl;
        cout << "蛋黄重量: " << egg_yolk_weight << endl;
        cout << "蛋壳重量: " << egg_shell_weight << endl;
    }

    float egg_shell_weight;
    float egg_weight;
};



int main(int argc, char const *argv[])
{
    egg myEgg(10.0f, 5.0f, 2.0f);
    myEgg.show();
    return 0;
}
